<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>Page Title</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <script>
    var n = 10000;
    var half = parseInt(n/2) - 1;
    var arr = new Array(half);
    for(var i=3; i < n; i+=2){
        arr[parseInt(i/2) - 1] = i;
    }
    console.time("a");
    var end=arr[half - 1];
    for(var j=0; Math.pow(arr[j], 2)<end ; j++){
        for(var k=j + 1; k < half - 1; k++){
            if(arr[k] % arr[j] == 0){
            arr[k]=0
            }
        }
    }
    var cnt=1
    for (const i in arr) {
        if(i!=0){
            console.log(typeof i);
            break;
            cnt++;   
        }
    }
    console.log(cnt)
    console.timeEnd("a");
    </script>
</head>
<body>
    
</body>
</html>